const mysql = require('mysql2/promise');
const config = require('./config');

// 创建并导出数据库连接池
const pool = mysql.createPool({
  host: config.DATABASE.host,
  user: config.DATABASE.user,
  password: config.DATABASE.password,
  database: config.DATABASE.database,
  waitForConnections: true,
  connectionLimit: 10,
  queueLimit: 0
});

module.exports = pool;